import Request from '../default'
import obj from '../api'

function getImages () {
  return Request({
    url: obj.banner,
    method: 'get'
  })
}

function getTypes () {
  return Request({
    url: obj.types,
    method: 'get'
  })
}

async function getTypesOnly () {
  const { data: res } = await Request({
    url: obj.types,
    method: 'get'
  })
  res.map(type => {
    delete type.products
    return type
  })
  return res
}

export {
  getImages,
  getTypes,
  getTypesOnly
}
